using System;
using System.Collections.Generic;
using UMC.Data;
namespace UMC.ITME.Entities
{
    public partial class Fingerprint
    {
        readonly static Action<Fingerprint, object>[] _SetValues = new Action<Fingerprint, object>[] { (r, t) => r.AuthType = Reflection.ParseObject(t, r.AuthType), (r, t) => r.Expire = Reflection.ParseObject(t, r.Expire), (r, t) => r.Id = Reflection.ParseObject(t, r.Id), (r, t) => r.Title = Reflection.ParseObject(t, r.Title), (r, t) => r.UA = Reflection.ParseObject(t, r.UA), (r, t) => r.UserAgent = Reflection.ParseObject(t, r.UserAgent) };
        readonly static string[] _Columns = new string[] { "AuthType", "Expire", "Id", "Title", "UA", "UserAgent" };
        protected override void SetValue(string name, object obv)
        {
            var index = Utility.Search(_Columns, name, StringComparer.CurrentCultureIgnoreCase);
            if (index > -1) _SetValues[index](this, obv);
        }
        protected override void GetValues(Action<String, object> action)
        {
            AppendValue(action, "AuthType", this.AuthType);
            AppendValue(action, "Expire", this.Expire);
            AppendValue(action, "Id", this.Id);
            AppendValue(action, "Title", this.Title);
            AppendValue(action, "UA", this.UA);
            AppendValue(action, "UserAgent", this.UserAgent);
        }

        protected override RecordColumn[] GetColumns()
        {
            var cols = new RecordColumn[6];
            cols[0] = RecordColumn.Column("AuthType", this.AuthType);
            cols[1] = RecordColumn.Column("Expire", this.Expire);
            cols[2] = RecordColumn.Column("Id", this.Id);
            cols[3] = RecordColumn.Column("Title", this.Title);
            cols[4] = RecordColumn.Column("UA", this.UA);
            cols[5] = RecordColumn.Column("UserAgent", this.UserAgent);
            return cols;
        }

    }
}
